package com.rainwood.water_authority.ui.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.rainwood.water_authority.R;
import com.rainwood.water_authority.base.MyBaseAdapter;
import com.rainwood.water_authority.http.response.InventoryHomeBean;
import com.rainwood.water_authority.http.response.ShouLiaoListBean;
import com.sxs.tools.utils.DateTimeUtil;

/**
 * @author Administrator
 * @auther : hhx
 * @date :  2021/3/17
 * @des :
 */
public class HistoryShouLiaoAdapter extends MyBaseAdapter<ShouLiaoListBean.DataBean.InfoBean> {
    public HistoryShouLiaoAdapter(@NonNull Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }
    private class ViewHolder extends MyBaseAdapter.ViewHolder{

        private final TextView tv_orderNo;
        private final TextView tv_time,tv_name,tv_direction;

        public ViewHolder() {
            super(R.layout.item_shouliaolist);
            tv_orderNo = (TextView) findViewById(R.id.tv_orderNo);
            tv_time = (TextView) findViewById(R.id.tv_time);
            tv_name = (TextView) findViewById(R.id.tv_name);
            tv_direction = (TextView) findViewById(R.id.tv_direction);
        }


        @Override
        public void onBindView(int position) {
            tv_orderNo.setText(getItem(position).getOrderNo());
            tv_time.setText(getItem(position).getDate());
            tv_name.setText(getItem(position).getName());
            tv_direction.setText(getItem(position).getDirection()+"单");
        }
    }
}
